import random

f = open("data.txt", "w")
rst = []
for i in range(0, 300):
    l = [random.randint(0, 6) for _ in range(0, 4)]
    if l[0] + l[1] >= l[2] + l[3]:
        l.append(1)
    else:
        l.append(0)
    for item in l:
        f.write(str(item) + " ")
    f.write("\n")
f.close()
